/**
 * 
 */
package com.oron3.bouncer.objects;

import com.oron3.bouncer.genericgl.GLWorld;
import com.oron3.bouncer.genericgl.MatrixTrackingGL;
import com.oron3.bouncer.objects.shapes.Arc;
import com.oron3.bouncer.objects.shapes.Point;
import com.oron3.bouncer.objects.shapes.Rectangle;

/**
 * @author Ofek
 *
 */
public class GLArc extends Arc implements GLShape {
	/**
	 * @param leftBottom
	 * @param lx
	 * @param ly
	 * @param lz
	 */
	public GLArc(final Point leftBottom, final float lx, final float ly, final float lz) {
		center = leftBottom.add(lx/2, ly/2, lz/2);
		recs.add(new GLRectangle(leftBottom.add(0,0,lz),leftBottom,leftBottom.add(lx,0,0)));
		recs.add(new GLRectangle(leftBottom.add(lx,0,0),leftBottom,leftBottom.add(0,ly,0)));
		recs.add(new GLRectangle(leftBottom.add(0,ly,0),leftBottom,leftBottom.add(0,0,lz)));

		recs.add(new GLRectangle(leftBottom.add(lx,0,0),leftBottom.add(lx,ly,0),leftBottom.add(lx,ly,lz)));
		recs.add(new GLRectangle(leftBottom.add(lx,ly,lz),leftBottom.add(lx,ly,0),leftBottom.add(0,ly,0)));
		recs.add(new GLRectangle(leftBottom.add(0,ly,lz),leftBottom.add(0,0,lz),leftBottom.add(lx,0,lz)));

	}

	/* (non-Javadoc)
	 * @see com.oron3.bouncer.objects.GLShape#setColor(com.oron3.bouncer.objects.Color)
	 */
	@Override
	public void setColor(final Color c) {
		for (final Rectangle r : recs) {
			((GLRectangle)r).setColor(c);
		}
	}

	/* (non-Javadoc)
	 * @see com.oron3.bouncer.objects.GLShape#draw(com.oron3.bouncer.genericgl.MatrixTrackingGL)
	 */
	@Override
	public void draw(final MatrixTrackingGL gl) {
		for (final Rectangle r : recs) {
			((GLRectangle)r).draw(gl);
		}
	}

	/* (non-Javadoc)
	 * @see com.oron3.bouncer.objects.GLShape#step(float, com.oron3.bouncer.genericgl.GLWorld)
	 */
	@Override
	public void step(final float dt, final GLWorld glWorld) {
	}





}
